package com.um2.qualite;

import junit.framework.TestCase;

public class HanoiTest extends TestCase {

	
	Hanoi h ;
	
	protected void setUp() throws Exception {
	}

	public final void testMoveDisk() {
		h = new Hanoi(3) ;
		h.moveDisk(0, 2) ;
		assertTrue(h.toString().equals("X\n\n^Tower 2\n\n(Empty) \n\n^Tower 1\nXX\nXXX\n\n^Tower 0\n--------HANOI BOARD-----------")) ;
	}

	public final void testMoveDisks() {
		h = new Hanoi(3) ;
		h.moveDisks(3, 0, 2, 1); 
		assertTrue(h.toString().equals("X\nXX\nXXX\n\n^Tower 2\n\n(Empty) \n\n^Tower 1\n\n(Empty) \n\n^Tower 0\n--------HANOI BOARD-----------")) ;
	}

	public final void testPlay() {
		Hanoi h= new Hanoi(3);
		h.play();
		assertTrue(h.toString().equals("X\nXX\nXXX\n\n^Tower 2\n\n(Empty) \n\n^Tower 1\n\n(Empty) \n\n^Tower 0\n--------HANOI BOARD-----------")) ;
	}

	public final void testToString() {
		Hanoi h= new Hanoi(3);
		h.play();
		assertTrue(h.toString().equals("X\nXX\nXXX\n\n^Tower 2\n\n(Empty) \n\n^Tower 1\n\n(Empty) \n\n^Tower 0\n--------HANOI BOARD-----------")) ;
	}

}
